import request from '@/utils/request'
import { download } from '@/utils/request'

// 新增优先答题
export function addYxd(data) {
  return request({
    url: '/businessCore/faFirstQuestions',
    method: 'post',
    data
  })
}

// 修改优先答题
export function updateYxd(data) {
  return request({
    url: '/businessCore/faFirstQuestions',
    method: 'put',
    data
  })
}

// 删除优先答题
export function delYxd(id) {
  return request({
    url: '/businessCore/faFirstQuestions/' + id,
    method: 'delete'
  })
}

// 获取优先答题
export function getYxd(id) {
  return request({
    url: '/businessCore/faFirstQuestions/' + id,
    method: 'get'
  })
}

// 导出优先答题
export function exportYxd(params, fileName) {
  const url = '/businessCore/faFirstQuestions/export'
  download(
    url,
    params,
    fileName + `_${new Date().getTime()}.xlsx`
  )
}